﻿using System;
using System.Diagnostics;

namespace Nave.Tecnique
{
    public class Timewatch : IDisposable
    {
        private string m_tag = string.Empty;

        private Stopwatch m_stopWatch = null;

        public Timewatch(string tag)
        {
            m_tag = tag;
            m_stopWatch = Stopwatch.StartNew();
        }

        public void Dispose()
        {
            m_stopWatch.Stop();
            UnityEngine.Debug.Log($"{m_tag} : use {m_stopWatch.ElapsedMilliseconds} ms !");
        }
    }

}